﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GmailAuto.core;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;

namespace GmailAuto
{
    public class Paginator : BasePage
    {
        // Locators
        [FindsBy(How = How.Id, Using = ":iu")] 
        private IWebElement previousEmails;

        [FindsBy(How = How.Id, Using = ":it")] 
        private IWebElement nextEmails;

        [FindsBy(How = How.CssSelector, Using = ".Dj")] 
        private IWebElement emailsCounter;

        /// <summary>
        /// Opens next page with emails
        /// </summary>
        public void GoNextEmails()
        {
            nextEmails.WaitUntilVisible().Click();
        }

        public void GoPreviousEmails()
        {
            previousEmails.WaitUntilVisible().Click();
        }
    }
}
